package com.smart_environmental_protection.controller;

import com.smart_environmental_protection.pojo.Store;
import com.smart_environmental_protection.service.StoreService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@RestController
public class StoreController {
    @Resource
    private StoreService storeService;

    @GetMapping({"/system/reclaimer/list"})
    public Map<String ,Object> storList(){
        Map map=new HashMap<String ,Object>();
        List<Store> store=storeService.storList();
        if (store!=null){
            map.put("success",true);
            map.put("msg","成功");
            map.put("code",200);
            map.put("rows",store);
        }else {
            map.put("success",false);
            map.put("msg","失败");
        }


        return map;
    }


}
